#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include<string>
using namespace std;

int main() {
    string input;
    getline(cin, input);
    size_t count = 0;
    for (auto right = input.end() - 1; *right != ' ' && right >= input.begin(); --right)
    {
        ++count;
    }
    cout << count << endl;
    return 0;
}
